/*
 * 
 * @author		: Anand Sivadas
 * @version		: 0.1
 * @Date		: Jul 21, 2014
 * 
 */
package com.sivadas.anand.service;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sivadas.anand.dao.EmployeeDAO;
import com.sivadas.anand.entity.EmployeeEntity;

/**
 * The Class EmployeeServiceImpl.
 *
 * @author 	: Anand Sivadas
 * @Date 	: Jul 21, 2014
 */
@Service
public class EmployeeServiceImpl implements EmployeeService {

	@Autowired
	private EmployeeDAO employeeDAO;

	/* (non-Javadoc)
	 * @see com.sivadas.anand.service.EmployeeService#addEmployee(com.sivadas.anand.entity.EmployeeEntity)
	 */
	@Transactional
	public void addEmployee(EmployeeEntity employee) {

		employeeDAO.addEmployee(employee);
	}

	/* (non-Javadoc)
	 * @see com.sivadas.anand.service.EmployeeService#listEmployees()
	 */
	@Transactional
	public List<EmployeeEntity> listEmployees() {

		return employeeDAO.getAllEmployees();
	}

	/* (non-Javadoc)
	 * @see com.sivadas.anand.service.EmployeeService#removeEmployee(java.lang.Integer)
	 */
	@Transactional
	public void removeEmployee(Integer id) {

		employeeDAO.deleteEmployee(id);
	}

}
